package com.d3works.apps.base.service;

import com.d3works.apps.base.db.Company;
import com.d3works.apps.base.db.Product;
import com.d3works.apps.base.db.ProductVariant;
import com.d3works.apps.base.db.ProductVariantConfig;
import com.d3works.apps.base.db.ProductVariantValue;
import com.d3works.exception.D3worksException;
import com.google.inject.persist.Transactional;
import java.math.BigDecimal;

public interface ProductService {

  @Transactional
  public void updateProductPrice(Product product) throws D3worksException;

  public String getSequence(Product product) throws D3worksException;

  public void updateSalePrice(Product product, Company company) throws D3worksException;

  public boolean hasActivePriceList(Product product);

  @Transactional
  public void generateProductVariants(Product productModel) throws D3worksException;

  public Product createProduct(Product productModel, ProductVariant productVariant, int seq)
      throws D3worksException;

  /**
   * @param productVariant
   * @param applicationPriceSelect - 1 : Sale price - 2 : Cost price - 3 : Purchase Price
   * @return
   */
  public BigDecimal getProductExtraPrice(ProductVariant productVariant, int applicationPriceSelect);

  public ProductVariant createProductVariant(
      ProductVariantConfig productVariantConfig,
      ProductVariantValue productVariantValue1,
      ProductVariantValue productVariantValue2,
      ProductVariantValue productVariantValue3,
      ProductVariantValue productVariantValue4,
      ProductVariantValue productVariantValue5);

  public void copyProduct(Product product, Product copy);
}
